home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / utils / fullwindow / fullwindow.s
Text File  |  1980-01-03  |  2KB  |  81 lines

  1. *
  2. * Ten minute utilities proudly presents:
  3. *
  4. * A very short utility to increase the current window size to the full screen
  5. * size, and changes the windows title to that given as argument
  6. * E.g.
  7. *
  8. * FullWindow My favourite source disk
  9. *
  10. * Would change the window's title to 'My favourite source disk' and increase
  11. * the windows size to the screen size
  12. *
  13. * Every time this is run, it uses a little memory to define the windows title
  14.  
  15.  
  16.     incdir    df0:include
  17.  
  18.     include    exec/exec_lib.i
  19.     include exec/memory.i
  20.     include    intuition/intuitionbase.i
  21.     include    intuition/intuition_lib.i
  22.     include    intuition/intuition.i
  23.     include    intuition/screens.i
  24.  
  25.     clr.b    -1(a0,d0.w)    Null terminate CLI arguments
  26.     move.l    a0,-(sp)    save argument for later = window title
  27.  
  28.     move.l    $4.w,a6        Allocate some memory for new CLI name
  29.     moveq    #MEMF_ANY,d1
  30.     jsr    _LVOAllocMem(a6)
  31.     move.l    d0,a0
  32.     tst.l    d0
  33.     beq.s    .fail
  34.     move.l    (sp)+,a1    Copy CLI name into this memory
  35. .strcpy    move.b    (a1)+,(a0)+
  36.     bne.s    .strcpy
  37.  
  38.     move.l    d0,-(sp)    save new CLI name for later
  39.  
  40.     move.l    $4.w,a6                Open Intuition.library
  41.     lea    IntName(pc),a1
  42.     jsr    _LVOOldOpenLibrary(a6)
  43.     move.l    d0,a6
  44.     tst.l    d0
  45.     beq.s    .fail
  46.  
  47.     move.l    ib_ActiveWindow(a6),a0        Move default window to (0,0)
  48.     move.w    wd_LeftEdge(a0),d0
  49.     ext.l    d0
  50.     neg.l    d0                d0 = Pixels to move in X dir
  51.     move.w    wd_TopEdge(a0),d1
  52.     ext.l    d1
  53.     neg.l    d1                d1 = Pixels to move in Y dir
  54.     jsr    _LVOMoveWindow(a6)
  55.  
  56.     move.l    ib_ActiveWindow(a6),a0        Size window to full scren
  57.     move.l    ib_ActiveScreen(a6),a1
  58.     move.w    sc_Width(a1),d0
  59.     sub.w    wd_Width(a0),d0
  60.     ext.l    d0                d0 = value to increase width
  61.     move.w    sc_Height(a1),d1
  62.     sub.w    wd_Height(a0),d1
  63.     ext.l    d1                d1 = value to increase height
  64.     jsr    _LVOSizeWindow(a6)
  65.  
  66.     move.l    ib_ActiveWindow(a6),a0
  67.     move.l    (sp),a1                new window title
  68.     move.w    #-1,a2                retain old screen title
  69.     jsr    _LVOSetWindowTitles(a6)
  70.  
  71.     move.l    a6,a1                Close intuition.library
  72.     move.l    $4.w,a6
  73.     jsr    _LVOCloseLibrary(a6)
  74.  
  75. .fail    addq.w    #4,sp                correct stack
  76.  
  77.     moveq    #0,d0                quit with no error
  78.     rts
  79.  
  80. IntName    INTNAME
  81.